import React, { Component,ComponentType } from 'react'
// 高阶组件
class App extends Component {
    render (){
        return (
            <div>
                <h3>react</h3>
                <p>React.js 是一个构建用户界面的库</p>
            </div>
        )
    }
}
// React.ComponentType 限制参数类型
const withCopyright = (WrapperComponent: ComponentType)=>{
    return class extends Component {
        render(){
            return (
                <>
                    <WrapperComponent></WrapperComponent>
                    <div>@copyright;版权所有 xxxx</div>
                </>
            )
        }
    }
}

const CopyrightApp = withCopyright(App);
export default CopyrightApp;
